package org.moda.sql.visitor;

import java.security.PublicKey;

// 定义SQL条件类型
 public sealed interface Condition permits Condition.SimpleValueCondition, Condition.SampleFieldCondition, Condition.CompositeCondition {
    String describe();

    public static record SimpleValueCondition<T>(String field, String operator, T value) implements Condition {
        @Override
        public String describe() {
            return "SimpleValueCondition{" + "field='" + field + '\'' + ", operator='" + operator + '\'' + '}';
        }
    }

    public static record SampleFieldCondition(String leftField, String operator, String rightField) implements Condition {
        @Override
        public String describe() {
            return "LogicalCondition{" + "operator='" + operator + '\'' + '}';
        }
    }

    public static record CompositeCondition(String operator, Condition... conditions) implements Condition {
        @Override
        public String describe() {
            return "CompositeCondition{" + "operator='" + operator + '\'' + '}';
        }
    }
}